/*package com.yinkgh.config;

import java.util.HashSet;
import java.util.Set;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.data.redis.connection.RedisNode;

import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.JedisCluster;

@Configuration
@PropertySource(value = "classpath:redis.properties")
public class JedisClusterConfig {
	
	@Value("${spring.redis.cluster.nodes}")
	private String clusterNodes;
	
	@Bean
	public JedisCluster jedisClusterConfig() {
		// Set<RedisNode> clusterNodes
		String[] serverArray = clusterNodes.split(",");
		Set<RedisNode> nodes = new HashSet<RedisNode>();
		for (String ipPort : serverArray) {
			String[] ipAndPort = ipPort.split(":");
			nodes.add(new RedisNode(ipAndPort[0].trim(), Integer.valueOf(ipAndPort[1])));
		}
		HostAndPort port = new HostAndPort(host, port);
		Set<HostAndPort> nodes = new HashSet<HostAndPort>();
		JedisCluster jedisCluster = new JedisCluster(nodes);
		return jedisCluster;
	}
	
}
*/